import Validator from "./Validator";

class FormValidator{
    form:any;
    constructor(form: any) {
        this.form = form;
    }

    /**
     * 验证手机号
     * @param rule
     * @param value
     * @param {Function} callback
     */
    mobile(rule?:any,value?:any,callback?:Function){
        const v = value.replace(/ /g, '');
        console.log(this);
        if(Validator.validator(v,Validator.phoneReg)){
            callback()
        }else {
            callback('手机号不合法');
        }
    }
}

export default FormValidator;